<%@ page import="com.atguigu.pojo.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: hasee
  Date: 2021/6/1
  Time: 20:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <%
            Person person=new Person();
            person.setName("国哥好帅");
            person.setPhones(new String[]{"168456463","15348465464","18645121"});
            List<String> cities=new ArrayList();
            cities.add("北京");
            cities.add("上海");
            cities.add("深圳");
             person.setCities(cities);

            Map<String,Object> map=new HashMap<>();
            map.put("key1","value1");
            map.put("key2","value2");
            map.put("key3","value3");
            person.setMap(map);

            pageContext.setAttribute("person",person);
        %>

        输出Person:
        ${person}<br/>
        输出Person的name属性：${person.name}<br/>
        输出Person的phone数组属性：${person.phones[0]}<br/>
        输出Person的cities集合中的元素值：${person.cities}<br/>
        输出Person的cities集合中个别元素值：${person.cities[0]}<br/>

        输出Person的Map集合中的元素值：${person.map}<br/>
        输出Person的Map集合中key1对应的值：${person.map.key1}<br/>

        输出Person的age属性 ${person.age}<br/>
</body>
</html>
